import Vue from 'vue'
import App from './App.vue'
import router from './routers/index';
import IMService from './assets/lib/imservice';
import GoEasyIM from './assets/lib/goeasy-im-1.4.0'

Vue.config.productionTip = false;

Vue.prototype.GoEasyIM = GoEasyIM;

let im = Vue.prototype.im = GoEasyIM.getInstance({
    host:'hangzhou.goeasy.io',
    appkey:'你的appkey'
});
//todo，应该在new的时候进行啊
Vue.prototype.imService = new IMService(im);

Vue.prototype.formatDate = function (t) {
    t = t || Date.now();
    let time = new Date(t);
    let str = time.getMonth() < 9 ? ('0' + (time.getMonth() + 1)) : (time.getMonth() + 1);
    str += '-';
    str += time.getDate() < 10 ? ('0' + time.getDate()) : time.getDate();
    str += ' ';
    str += time.getHours();
    str += ':';
    str += time.getMinutes() < 10 ? ('0' + time.getMinutes()) : time.getMinutes();
    return str;
};


new Vue({
    render: h => h(App),
    router
}).$mount('#app')
